<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Promise.allSettled</title>
</head>
<body>
<script>
    // 声明两个Promise对象
    const promise1=new Promise((resolve, reject) => {
        setTimeout(()=>{
            resolve('SUCCESS!')
        },1000)
    })
    const promise2=new Promise((resolve, reject) => {
        setTimeout(()=>{
            // resolve('SUCCESS!')
            reject('err!')
        },1000)
    })
    const result=Promise.allSettled([promise1,promise2])
    // const result=Promise.all([promise1,promise2])
    console.log(result)
</script>
</body>
</html>